@extends('layouts.console_header')

@section('title', '反馈管理')

@section('resources')
    @parent
    <!-- css 文件 -->

@endsection

@section('content')
<!--  html内容  -->
<section class="user_list">
    <div style="border-bottom: 2px solid #9955c6;overflow: hidden;">
        <p class="fz_14 account_title fl" style="border: none;"><span style="color: #7f7f7f;"><a href="/console/index">首页</a>>商家版运营></span><span class="co_violet">反馈管理</span></p>
        {{--<p class="fz_14 account_title">--}}
            {{--<span style="color: #7f7f7f;"><a href="/console/index">首页</a>>商家版运营></span>--}}
            {{--<span class="co_violet">反馈管理</span>--}}
        {{--</p>--}}
        <a href="#"  onclick="export_data()"><p class="fr tc back_btn">导出</p></a>
    </div>
    <table id="example" class="display" cellspacing="0" width="100%">
        <thead>
            <tr>
                <th>序号</th>
                <th>反馈内容</th>
                <th>反馈时间</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
        </thead>
        <tfoot>
            <tr>
                <th>序号</th>
                <th>反馈内容</th>
                <th>反馈时间</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
        </tfoot>
        <tbody>
            @foreach($lists as $list)
                <tr>
                    @if(!isset($i))
                        <td>{{$i=1}}</td>
                    @else
                        <td>{{++$i}}</td>
                    @endif
                    <td>{{$list['content']}}</td>
                    <td>{{date('Y-m-d H:i', strtotime($list['created_at']))}}</td>
                @if($list['status'] == '1')
                    <td>已处理</td>
                @else
                    <td>未处理</td>
                @endif
                    <td>
                        <a style="margin-right: 10px;" class="co_violet" href="/console/shop/feedback/get?feedbackid={{$list['id']}}&cityid={{$cityid}}">详情</a>
                    </td>
                </tr>
            @endforeach
        </tbody>
    </table>
</section>
@endsection

@section('scriptResources')
    @parent
    <!-- js 文件-->
<script>
    function export_data() {
        var startTime = $("input[name='starttime']").val();
        var lastTime = $("input[name='lasttime']").val();
        var cityid = "{{$cityid}}";
//        if(!startTime || !lastTime) {
//            alert('请选择开始时间和结束时间'); return;
//        }
        window.open("/console/shop/feedback/manage/export?cityid="+cityid+"&starttime="+startTime+"&lasttime="+lastTime+"&type=shop", '_blank');
    }
    $(".user_list_searchbtn").click(function() {
        var search=$("input[name='search']").val();
        if(search == '') {
            return;
        }
        window.location.href = "/console/shop/feedback/manage?cityid="+cityid+"&search="+search+"&starttime="+starttime+"&lasttime="+lasttime+"&now=" + Date.parse(new Date());
    });
</script>
@endsection